define(function(require, exports, module) {
	var common = require('common');
	var zNodes = [{
		id: 1,
		pId: 0,
		name: "北京总公司",
		open: true
	}, {
		id: 11,
		pId: 1,
		name: "经理办公室"
	}, {
		id: 12,
		pId: 1,
		name: "人事部"
	}, {
		id: 13,
		pId: 1,
		name: "技术部"
	}, {
		id: 14,
		pId: 1,
		name: "上海分公司",
		open: true
	}, {
		id: 121,
		pId: 14,
		name: "技术部"
	}, {
		id: 122,
		pId: 14,
		name: "市场部"
	}, ];

	var init = function(pbox) {
		$.fn.zTree.init($("#treeCompany"), {
			check: {
				enable: false,
				nocheckInherit: true
			},
			data: {
				simpleData: {
					enable: true
				}
			}
		}, zNodes);
		$("#btnTreeSelect").click(function() {
			var treeObj = $.fn.zTree.getZTreeObj("treeCompany")
			pbox.options.returnValue = treeObj.getSelectedNodes()[0].name;
			pbox.close();
		});
		$("#btnTreeClose").click(function() {
			pbox.close();
		});
	}

	return {
		init: init
	}
});